package edu.maping.easy.sequence.ticker;

import edu.maping.easy.gui.GuiFactory;
import edu.maping.easy.model.Thing;
import processing.core.PApplet;
import processing.xml.XMLElement;

public class TimeTicker implements Ticker {

	private boolean trigger = false;

	private long period = 50;

	@Override
	public boolean isTrigerred() {
		return trigger;
	}

	@Override
	public void updateTrigger(PApplet pApplet, Thing thing) {
		if (pApplet.frameCount % period == 0) {
			trigger = true;
		} else
			trigger = false;
	}

	@Override
	public String getName() {
		return "Time Ticker";
	}

	@Override
	public Ticker newTicker() {
		return new TimeTicker();
	}

	@Override
	public boolean isReadyToNewTicker() {
		return true;
	}

	@Override
	public boolean setReadyToNewTicker() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void desXmlIzation(XMLElement seqsElement) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public XMLElement xmlIzation() {
		// TODO Auto-generated method stub
		return null;
	}

}
